﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="ScheduleList.aspx.cs" Inherits="Admin_ScheduleList" %>

<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
    <h2>
        Flight Schedule</h2>
    <div style="width: 100%" align="center">
        <asp:gridview id="GridView1" runat="server" allowpaging="True" allowsorting="True"
            autogeneratecolumns="False" datasourceid="SqlDataSource1" width="100%" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None">
            <columns>
                    <asp:BoundField DataField="CityFrom" HeaderText="From" 
                        SortExpression="CityFrom" >
                    <ItemStyle BackColor="#99FFCC" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CountryFrom" HeaderText="Country" 
                        SortExpression="CountryFrom" >
                    <ItemStyle BackColor="#99FFCC" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CityTo" HeaderText="To" SortExpression="CityTo" >
                    <ItemStyle BackColor="#CC99FF" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CountryTo" HeaderText="Country" 
                        SortExpression="CountryTo" >
                    <ItemStyle BackColor="#CC99FF" HorizontalAlign="Center" 
                        VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DepartTime" DataFormatString="{0:t}" 
                        HeaderText="Depart Time" SortExpression="DepartTime" >
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FlyHour" HeaderText="Fly Hours" 
                        SortExpression="FlyHour" >
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DayofWeek" HeaderText="Day of Week" 
                        SortExpression="DayofWeek" >
                    <ItemStyle BackColor="#B7CBEB" />
                    </asp:BoundField>
                </columns>
            <emptydatatemplate>
                    No Data Found
                </emptydatatemplate>
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        </asp:gridview>
        <br />
        <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:sqlString %>"
            selectcommand="SELECT Airline_Schedule.DayofWeek, Airline_Schedule.DepartTime, Airline_Route.FlyHour, Airline_Cities.[City Name] AS CityFrom, Airline_Cities_1.[City Name] AS CityTo, Airline_Cities_1.Country AS CountryTo, Airline_Cities.Country AS CountryFrom FROM Airline_Cities INNER JOIN Airline_Route ON Airline_Cities.CityID = Airline_Route.OriginalCityID INNER JOIN Airline_Schedule ON Airline_Route.RouteID = Airline_Schedule.RouteID INNER JOIN Airline_Cities AS Airline_Cities_1 ON Airline_Route.DestinationCityID = Airline_Cities_1.CityID">
        </asp:sqldatasource>
        <br />
        <asp:button id="Button1" runat="server" onclick="Button1_Click" postbackurl="~/Admin/AddSchedule.aspx"
            text="Add Schedule" />
    </div>
</asp:content>
